package com.atguigu.springcloud.controlle;

import com.atguigu.springcloud.domain.CommonResult;
import com.atguigu.springcloud.service.AccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @ClassName:
 * @Description:
 * @version: v1.1.0
 * @author: shuaiqin
 * @date: 2021/9/20-18:02
 * <p>
 * Modification History:
 * Date         Author          Version            Description
 * ------------------------------------------------------------
 * 2021/9/20          shuaiqin          v1.1.0               修改原因
 */
@RestController
@Slf4j
public class AccountController {
    @Autowired
    private AccountService accountService;
    @PostMapping(value = "/account/decrease")
    public CommonResult decrease(Long userId, BigDecimal money){
        accountService.dscrease(userId,money);
        return new CommonResult(200,"扣费成功");
    }
}
